#pragma once

#include <string>
#include <map>
#include <stdexcept>

class Config {
public:
    Config() = default;
    
    bool load(const std::string& filename);
    
    // 获取配置值
    std::string getString(const std::string& key, const std::string& defaultValue = "") const;
    int getInt(const std::string& key, int defaultValue = 0) const;
    double getDouble(const std::string& key, double defaultValue = 0.0) const;
    bool getBool(const std::string& key, bool defaultValue = false) const;

    // 交易参数
    struct TradingParams {
        std::string symbol;
        double tick_size;
        int lot_size;
        double max_position;
    };

    // 风控参数
    struct RiskParams {
        double max_drawdown;
        double max_daily_loss;
        double max_order_value;
    };

    // 获取结构化参数
    TradingParams getTradingParams() const;
    RiskParams getRiskParams() const;

private:
    std::map<std::string, std::string> m_config;
};